/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Hnmtuan
 */
@Entity
@Table(name = "banking")
@NamedQueries({
    @NamedQuery(name = "Banking.findAll", query = "SELECT b FROM Banking b"),
    @NamedQuery(name = "Banking.findByIdBanking", query = "SELECT b FROM Banking b WHERE b.idBanking = :idBanking"),
    @NamedQuery(name = "Banking.findByCreatedDate", query = "SELECT b FROM Banking b WHERE b.createdDate = :createdDate"),
    @NamedQuery(name = "Banking.findByBalance", query = "SELECT b FROM Banking b WHERE b.balance = :balance"),
    @NamedQuery(name = "Banking.findByHostname", query = "SELECT b FROM Banking b WHERE b.hostname = :hostname"),
    @NamedQuery(name = "Banking.findByBankState", query = "SELECT b FROM Banking b WHERE b.bankState = :bankState")})
public class Banking implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdBanking")
    private String idBanking;
    @Column(name = "CreatedDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdDate;
    @Column(name = "Balance")
    private Float balance;
    @Column(name = "Hostname")
    private String hostname;
    @Column(name = "BankState")
    private Integer bankState;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "banking")
    private List<Customer> customerList;

    public Banking() {
    }

    public Banking(String idBanking) {
        this.idBanking = idBanking;
    }

    public String getIdBanking() {
        return idBanking;
    }

    public void setIdBanking(String idBanking) {
        this.idBanking = idBanking;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Float getBalance() {
        return balance;
    }

    public void setBalance(Float balance) {
        this.balance = balance;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public Integer getBankState() {
        return bankState;
    }

    public void setBankState(Integer bankState) {
        this.bankState = bankState;
    }

    public List<Customer> getCustomerList() {
        return customerList;
    }

    public void setCustomerList(List<Customer> customerList) {
        this.customerList = customerList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBanking != null ? idBanking.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Banking)) {
            return false;
        }
        Banking other = (Banking) object;
        if ((this.idBanking == null && other.idBanking != null) || (this.idBanking != null && !this.idBanking.equals(other.idBanking))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.Banking[idBanking=" + idBanking + "]";
    }

}
